package com.neusoft.mapper;

import com.neusoft.po.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {

    @Select("select * from user where userId=#{userId} and password=#{password}")
    public User getUserByIdByPass(User user);

    @Select("select * from user where userId=#{userId}")
    public User getUserById(String userId);

    @Insert("insert into user values(#{userId},#{password},#{userName},#{userSex},#{userImg},1,null)")
    public int saveUser(User user);

    @Update("Update user SET token=#{token} where userId=#{userId}")
    public int saveToken(@Param("userId") String userId, @Param("token") String token);

    @Select("select token from user where userId=#{userId}")
    public String getToken(String userId);

    public int updateUserById(User user);

}
